package cn.gok;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author: chen fan
 * @since: 2022/11/4 15:30
 * @description:
 */
@Controller
public class TestControllerPathVariable {

    @PutMapping("/user/{id}")
    public String updateUser(User user,
                             @PathVariable("id") Integer id){
        System.out.println("id: " + id);
        System.out.println("执行修改操作。。。。");
        return "success";
    }
    @DeleteMapping("/user/{id}")
    public String deleteUser(@PathVariable("id") Integer id){
        System.out.println("id: " + id);
        System.out.println("执行删除操作。。。。");
        return "success";
    }

    @GetMapping("/user/{id}")
    public String getUser(@PathVariable("id") Integer id){
        System.out.println("id: " + id);
        System.out.println("获取用户信息。。。。");
        return "success";
    }
}
